package brovia.logic;

import java.util.ArrayList;



public class Movie {
	private Movie(MovieBuilder movieBuilder)  {
		id = movieBuilder.id;
		name = movieBuilder.name;
		releaseYear = movieBuilder.releaseYear;
		genres = movieBuilder.genres;
	}
	private final int id;
	private final String name;
	private final String releaseYear;
	private final ArrayList<Genre> genres;
	
	public static class MovieBuilder {
		//Required Parameters
		private final String name;		
		private final ArrayList<Genre> genres;
		
		
		//Optional Parameters - initialized to default values
		private int id = 0;
		private String releaseYear = "Unknown";
		
		public MovieBuilder(String name, ArrayList<Genre> genres) {
			this.name = name;
			this.genres = genres;
		}
		
		public MovieBuilder id(int value) {
			id = value;
			return this;
		}
		
		public MovieBuilder releaseYear(String value) {
			releaseYear = value;
			return this;
		}		
		
		public Movie build() {
			return new Movie(this);
		}
		
	}
	
	public enum Genre {
		Action,Adventure,Animation,Biography,Comedy,
		Documentary,Drama,Family,Fantasy,History,
		Musical,Mystery,Romance,ScienceFiction,Sport,
		Thriller,War,Western,Unknown
	}
		
	/**
	 * @return name, relaseYear and genres
	 */
	@Override
	public String toString() {		
		return (id + " " + name + " " + releaseYear + " " + genres);
	}

	/**
	 * @return the id
	 */
	public int getId() {
		return id;
	}

	/**
	 * @return the name
	 */
	public String getName() {
		return name;
	}

	/**
	 * @return the releaseYear
	 */
	public String getReleaseYear() {
		return releaseYear;
	}

	/**
	 * @return the genres
	 */
	public ArrayList<Genre> getGenres() {
		return genres;
	}

}